package com.atung.provider;

import java.util.Objects;

import org.apache.ibatis.jdbc.SQL;

import com.atung.model.BusRoutApplication;

public class BusRoutApplicationProvider {

	/**
	 * 新增申请信息
	 * @param busRoutApplication
	 * @return
	 */
	public String saveBusRoutApplication(BusRoutApplication busRoutApplication){
		
		return new SQL(){
			{
				INSERT_INTO("bus_rout_application");
				VALUES("id", "#{id}");
				VALUES("application_open_id", "#{applicationOpenId}");
				VALUES("depart_city_id", "#{departCityId}");
				VALUES("departl_id", "#{departlId}");	
				VALUES("departl_name", "#{departlName}");
				VALUES("destination_city_id", "#{destinationCityId}");
				VALUES("destination_id", "#{destinationId}");
				VALUES("destination", "#{destination}");
				if(Objects.nonNull(busRoutApplication.getIsDelect())){
					VALUES("is_delect", "#{isDelect}");
				}
				VALUES("creation_time", "#{creationTime}");
				VALUES("modification_time", "#{modificationTime}");	
			}
		}.toString();
	}
}
